package com.kob.kobbackend.controller.user.bot;

import com.kob.kobbackend.pojo.Bot;
import com.kob.kobbackend.service.impl.UserBotServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/user/bot/")
public class UserBotController {
    @Autowired
    private UserBotServiceImpl userBotService;

    @PostMapping("add/")
    public Map<String,String> add(@RequestBody Map<String,String> data) {
        return userBotService.add(data);
    }

    @GetMapping("getlist/")
    public List<Bot> getList(){
        return userBotService.getList();
    }

    @PostMapping("remove/")
    public Map<String,String> remove(@RequestBody Map<String,String> data) {
        return userBotService.remove(data);
    }

    @PostMapping("update/")
    public Map<String,String> update(@RequestBody Map<String,String> data){
        return userBotService.update(data);
    }
}
